package tj.warning.pull.mapper.report3;


import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tj.warning.pull.model.SyncRecord;

public interface SyncRecordMapper {
    @Insert({"insert into sync_record (id,table_name,collect_time,working) values(#{record.id,jdbcType=VARCHAR},#{record.tableName,jdbcType=VARCHAR},#{record.collectTime,jdbcType=VARCHAR},#{record.working,jdbcType=VARCHAR})"})
    void insert(@Param("record") SyncRecord paramSyncRecord);

    @Update({"truncate table sync_record"})
    void truncate();

    @Select({"select id,table_name as tableName,collect_time as collectTime from sync_record"})
    List<SyncRecord> selectList();

    @Update({"update sync_record set collect_time=#{record.collectTime} where id=#{record.id}"})
    void updateById(@Param("record") SyncRecord paramSyncRecord);

    @Delete({"delete from sync_record where id=#{id}"})
    void deleteById(@Param("id") String paramString);


}
